package pk.nak.utils;

import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class XMLUtils {
	public static final String getTextValue(Element ele, String tagName) {
		String textVal = "";
		NodeList nl = ele.getElementsByTagName(tagName);
		if(nl != null && nl.getLength() > 0) {
			Element el = (Element)nl.item(0);
			if ( el.getChildNodes().getLength() > 0 )
				textVal = el.getFirstChild().getNodeValue();
		}

		return textVal;
	}
}
